home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
hewin
/
ccisrc
/
he386.cci
< prev
next >
Wrap
Text File
|
1993-11-30
|
3KB
|
113 lines
/*************************************************************************
* "he386.cci"
*************************************************************************/
char *_he386p_ = "he386p.exp";
/* "i:/hc/guilib3/prg/mml" */
char HE386_CCIPATH_KEY[16] = {'H','e','3','8','6','_','c','c','i','p','a','t','h','\0'};
char he386_ccipath[256] = {0};
char he386_option[256] = {0};
int he386_compile( char *pn )
{
int ret, drv;
char tmp[256], fn[256];
/* カレント変更 */
drv = toupper(pn[0]) - 'A';
FS_chdrv(drv);
FS_getDnamPath(tmp,pn);
FS_chdir(tmp);
/* DTA 領域の設定 */
AplDtaInit();
if ( he386_ccipath[0] )
sprintf( tmp, "-cciPath %s", he386_ccipath);
else
tmp[0] = '\0';
AplDtaSetStr( "$MainArg", "%s %s %s %s", _he386p_, he386_option, tmp, pn );
ret = AplPclExec( _he386p_, 0 );
FS_getFnam(fn,pn);
FS_appendSnam( fn, fn, ".mid" );
if ( FS_isFileExist(fn) > 0 )
MID_playStart( fn );
return (NORMAL);
}
int he386_menu( char *pn )
{
int ret;
char tmp[256];
char *dlg;
char *mnu;
char *obj;
char *p;
if ( pn[0] == '\0' )
return (NORMAL);
if ( (p = AMAC_getName(SysMacro,HE386_CCIPATH_KEY)) == NULL )
{ /* デフォルト */
p = AplGetStartPath();
sprintf( he386_ccipath,"%c:/USR/HE386", *p );
AMAC_setKey( SysMacro,HE386_CCIPATH_KEY,he386_ccipath);
} else
{
strcpy( he386_ccipath, p );
}
obj = MNU_alloc(4);
MNU_setObj(obj, 0, MNU_NOR, 'O', "Option" , NULL, 1, NULL, NULL);
MNU_setObj(obj, 1, MNU_NOR, 'P', "CCI Path" , NULL, 2, NULL, NULL);
MNU_setObj(obj, 2, MNU_BLK, 0 , NULL , NULL, 3, NULL, NULL);
MNU_setObj(obj, 3, MNU_NOR, 'C', "Compile (normal)", NULL, 4, NULL, NULL);
mnu = MNU_open( DLGPOS_MOS_SET_HOME, DLGPOS_MOS_SET_HOME, MNUATT_EXIT,
obj, "MML Compile" );
LOOP
{
ret = MNU_start ( mnu );
switch ( ret )
{
case 1: /* option */
dlg = DLG_getsOpen( DLGPOS_MOS_SET_HOME, DLGPOS_MOS_SET_HOME, 320,
"HE386 のオプションパラメータを入力してください。");
DLG_getsSetTitle( dlg, "MML Compiler option parameter" );
strcpy( tmp, he386_option);
ret = DLG_getsStart( dlg, 255, tmp );
if ( ret >= 0 )
strcpy( he386_option, tmp );
DLG_getsClose(dlg);
break;
case 2: /* CCI path */
dlg = DLG_getsOpen( DLGPOS_MOS_SET_HOME, DLGPOS_MOS_SET_HOME, 320,
"HE386.CCI 格納パス名を入力してください。");
DLG_getsSetTitle( dlg, "MML compile cci path" );
strcpy( tmp, he386_ccipath);
ret = DLG_getsStart( dlg, 255, tmp );
if ( ret > 0 )
{
strcpy( he386_ccipath, tmp );
AMAC_setKey( SysMacro,HE386_CCIPATH_KEY,he386_ccipath);
}
DLG_getsClose(dlg);
break;
case 4: /* compile */
he386_compile( pn );
goto _RET;
default:
goto _RET;
}
}
_RET:
MNU_close(mnu);
MNU_free(obj);
return (NORMAL);
}